package org.gap.domain;

import java.io.Serializable;

import java.lang.StringBuilder;

import java.math.BigDecimal;

import java.util.Set;

import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

import javax.xml.bind.annotation.*;

import javax.persistence.*;

/**
 */

@Entity
@NamedQueries({
		@NamedQuery(name = "findAllCaractPMs", query = "select myCaractPM from CaractPM myCaractPM"),
		@NamedQuery(name = "findCaractPMByCpmChiffreAffaire", query = "select myCaractPM from CaractPM myCaractPM where myCaractPM.cpmChiffreAffaire = ?1"),
		@NamedQuery(name = "findCaractPMByCpmCodeNaf", query = "select myCaractPM from CaractPM myCaractPM where myCaractPM.cpmCodeNaf = ?1"),
		@NamedQuery(name = "findCaractPMByCpmCodeNafContaining", query = "select myCaractPM from CaractPM myCaractPM where myCaractPM.cpmCodeNaf like ?1"),
		@NamedQuery(name = "findCaractPMByCpmEtatSociete", query = "select myCaractPM from CaractPM myCaractPM where myCaractPM.cpmEtatSociete = ?1"),
		@NamedQuery(name = "findCaractPMByCpmEtatSocieteContaining", query = "select myCaractPM from CaractPM myCaractPM where myCaractPM.cpmEtatSociete like ?1"),
		@NamedQuery(name = "findCaractPMByCpmFormeJuridique", query = "select myCaractPM from CaractPM myCaractPM where myCaractPM.cpmFormeJuridique = ?1"),
		@NamedQuery(name = "findCaractPMByCpmFormeJuridiqueContaining", query = "select myCaractPM from CaractPM myCaractPM where myCaractPM.cpmFormeJuridique like ?1"),
		@NamedQuery(name = "findCaractPMByCpmNbrSalarier", query = "select myCaractPM from CaractPM myCaractPM where myCaractPM.cpmNbrSalarier = ?1"),
		@NamedQuery(name = "findCaractPMByCpmNomSociete", query = "select myCaractPM from CaractPM myCaractPM where myCaractPM.cpmNomSociete = ?1"),
		@NamedQuery(name = "findCaractPMByCpmNomSocieteContaining", query = "select myCaractPM from CaractPM myCaractPM where myCaractPM.cpmNomSociete like ?1"),
		@NamedQuery(name = "findCaractPMByCpmQualiteSociete", query = "select myCaractPM from CaractPM myCaractPM where myCaractPM.cpmQualiteSociete = ?1"),
		@NamedQuery(name = "findCaractPMByCpmQualiteSocieteContaining", query = "select myCaractPM from CaractPM myCaractPM where myCaractPM.cpmQualiteSociete like ?1"),
		@NamedQuery(name = "findCaractPMByCpmSiren", query = "select myCaractPM from CaractPM myCaractPM where myCaractPM.cpmSiren = ?1"),
		@NamedQuery(name = "findCaractPMByCpmSirenContaining", query = "select myCaractPM from CaractPM myCaractPM where myCaractPM.cpmSiren like ?1"),
		@NamedQuery(name = "findCaractPMByCpmSiret", query = "select myCaractPM from CaractPM myCaractPM where myCaractPM.cpmSiret = ?1"),
		@NamedQuery(name = "findCaractPMByCpmSiretContaining", query = "select myCaractPM from CaractPM myCaractPM where myCaractPM.cpmSiret like ?1"),
		@NamedQuery(name = "findCaractPMByCpmTiers", query = "select myCaractPM from CaractPM myCaractPM where myCaractPM.cpmTiers = ?1"),
		@NamedQuery(name = "findCaractPMByCpmTiersContact", query = "select myCaractPM from CaractPM myCaractPM where myCaractPM.cpmTiersContact = ?1"),
		@NamedQuery(name = "findCaractPMByPrimaryKey", query = "select myCaractPM from CaractPM myCaractPM where myCaractPM.cpmTiers = ?1") })
@Table(schema = "GAP", name = "CARACT_P_M")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(namespace = "GAP_v2/org/gap/domain", name = "CaractPM")
public class CaractPM implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 */

	@Column(name = "CPM_TIERS", nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	@XmlElement
	Integer cpmTiers;
	/**
	 */

	@Column(name = "CPM_NOM_SOCIETE", length = 40)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String cpmNomSociete;
	/**
	 */

	@Column(name = "CPM_FORME_JURIDIQUE", length = 10)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String cpmFormeJuridique;
	/**
	 */

	@Column(name = "CPM_CODE_NAF", length = 4)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String cpmCodeNaf;
	/**
	 */

	@Column(name = "CPM_SIREN", length = 9)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String cpmSiren;
	/**
	 */

	@Column(name = "CPM_SIRET", length = 14)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String cpmSiret;
	/**
	 */

	@Column(name = "CPM_TIERS_CONTACT")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	Integer cpmTiersContact;
	/**
	 */

	@Column(name = "CPM_QUALITE_SOCIETE", length = 20)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String cpmQualiteSociete;
	/**
	 */

	@Column(name = "CPM_ETAT_SOCIETE", length = 1)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String cpmEtatSociete;
	/**
	 */

	@Column(name = "CPM_CHIFFRE_AFFAIRE", precision = 18)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	BigDecimal cpmChiffreAffaire;
	/**
	 */

	@Column(name = "CPM_NBR_SALARIER")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	Integer cpmNbrSalarier;

	/**
	 */
	@PrimaryKeyJoinColumn
	@OneToOne(fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	Tiers tiers;

	/**
	 */
	public void setCpmTiers(Integer cpmTiers) {
		this.cpmTiers = cpmTiers;
	}

	/**
	 */
	public Integer getCpmTiers() {
		return this.cpmTiers;
	}

	/**
	 */
	public void setCpmNomSociete(String cpmNomSociete) {
		this.cpmNomSociete = cpmNomSociete;
	}

	/**
	 */
	public String getCpmNomSociete() {
		return this.cpmNomSociete;
	}

	/**
	 */
	public void setCpmFormeJuridique(String cpmFormeJuridique) {
		this.cpmFormeJuridique = cpmFormeJuridique;
	}

	/**
	 */
	public String getCpmFormeJuridique() {
		return this.cpmFormeJuridique;
	}

	/**
	 */
	public void setCpmCodeNaf(String cpmCodeNaf) {
		this.cpmCodeNaf = cpmCodeNaf;
	}

	/**
	 */
	public String getCpmCodeNaf() {
		return this.cpmCodeNaf;
	}

	/**
	 */
	public void setCpmSiren(String cpmSiren) {
		this.cpmSiren = cpmSiren;
	}

	/**
	 */
	public String getCpmSiren() {
		return this.cpmSiren;
	}

	/**
	 */
	public void setCpmSiret(String cpmSiret) {
		this.cpmSiret = cpmSiret;
	}

	/**
	 */
	public String getCpmSiret() {
		return this.cpmSiret;
	}

	/**
	 */
	public void setCpmTiersContact(Integer cpmTiersContact) {
		this.cpmTiersContact = cpmTiersContact;
	}

	/**
	 */
	public Integer getCpmTiersContact() {
		return this.cpmTiersContact;
	}

	/**
	 */
	public void setCpmQualiteSociete(String cpmQualiteSociete) {
		this.cpmQualiteSociete = cpmQualiteSociete;
	}

	/**
	 */
	public String getCpmQualiteSociete() {
		return this.cpmQualiteSociete;
	}

	/**
	 */
	public void setCpmEtatSociete(String cpmEtatSociete) {
		this.cpmEtatSociete = cpmEtatSociete;
	}

	/**
	 */
	public String getCpmEtatSociete() {
		return this.cpmEtatSociete;
	}

	/**
	 */
	public void setCpmChiffreAffaire(BigDecimal cpmChiffreAffaire) {
		this.cpmChiffreAffaire = cpmChiffreAffaire;
	}

	/**
	 */
	public BigDecimal getCpmChiffreAffaire() {
		return this.cpmChiffreAffaire;
	}

	/**
	 */
	public void setCpmNbrSalarier(Integer cpmNbrSalarier) {
		this.cpmNbrSalarier = cpmNbrSalarier;
	}

	/**
	 */
	public Integer getCpmNbrSalarier() {
		return this.cpmNbrSalarier;
	}

	/**
	 */
	public void setTiers(Tiers tiers) {
		this.tiers = tiers;
	}

	/**
	 */
	public Tiers getTiers() {
		return tiers;
	}

	/**
	 */
	public CaractPM() {
	}

	/**
	 * Copies the contents of the specified bean into this bean.
	 *
	 */
	public void copy(CaractPM that) {
		setCpmTiers(that.getCpmTiers());
		setCpmNomSociete(that.getCpmNomSociete());
		setCpmFormeJuridique(that.getCpmFormeJuridique());
		setCpmCodeNaf(that.getCpmCodeNaf());
		setCpmSiren(that.getCpmSiren());
		setCpmSiret(that.getCpmSiret());
		setCpmTiersContact(that.getCpmTiersContact());
		setCpmQualiteSociete(that.getCpmQualiteSociete());
		setCpmEtatSociete(that.getCpmEtatSociete());
		setCpmChiffreAffaire(that.getCpmChiffreAffaire());
		setCpmNbrSalarier(that.getCpmNbrSalarier());
		setTiers(that.getTiers());
	}

	/**
	 * Returns a textual representation of a bean.
	 *
	 */
	public String toString() {

		StringBuilder buffer = new StringBuilder();

		buffer.append("cpmTiers=[").append(cpmTiers).append("] ");
		buffer.append("cpmNomSociete=[").append(cpmNomSociete).append("] ");
		buffer.append("cpmFormeJuridique=[").append(cpmFormeJuridique).append("] ");
		buffer.append("cpmCodeNaf=[").append(cpmCodeNaf).append("] ");
		buffer.append("cpmSiren=[").append(cpmSiren).append("] ");
		buffer.append("cpmSiret=[").append(cpmSiret).append("] ");
		buffer.append("cpmTiersContact=[").append(cpmTiersContact).append("] ");
		buffer.append("cpmQualiteSociete=[").append(cpmQualiteSociete).append("] ");
		buffer.append("cpmEtatSociete=[").append(cpmEtatSociete).append("] ");
		buffer.append("cpmChiffreAffaire=[").append(cpmChiffreAffaire).append("] ");
		buffer.append("cpmNbrSalarier=[").append(cpmNbrSalarier).append("] ");

		return buffer.toString();
	}

	/**
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = (int) (prime * result + ((cpmTiers == null) ? 0 : cpmTiers.hashCode()));
		return result;
	}

	/**
	 */
	public boolean equals(Object obj) {
		if (obj == this)
			return true;
		if (!(obj instanceof CaractPM))
			return false;
		CaractPM equalCheck = (CaractPM) obj;
		if ((cpmTiers == null && equalCheck.cpmTiers != null) || (cpmTiers != null && equalCheck.cpmTiers == null))
			return false;
		if (cpmTiers != null && !cpmTiers.equals(equalCheck.cpmTiers))
			return false;
		return true;
	}
}
